The present invention relates to a technique for a data write device which performs data write control.
In an electronic control device which controls a control target, a learning control is applied which writes, in an EEPROM in advance, a control value (learned value) in consideration of a difference (offset) between a previous target control value and an actual measured value when a control target is actually controlled on the basis of the target control value, and controls the control target on the basis of the learned value at the time of control, such that optimum control can be performed with no effect of a change with age or an individual difference of the control target.
When a CPU of the electronic control device writes a learned value in an EEPROM, a learned value based on a difference between a target control value and an actual measured value input from an external sensor of the electronic control device is calculated in a RAM serving as a working area, and the calculated learned value is written in the EEPROM.
At this time, if the system is powered off by a user or because of an abnormality, such as loose connection of a connector, the power supply from a power source to the electronic control device is stopped, thus data written in the RAM is erased. For this reason, there is a problem in that the learned value may not be written in the EEPROM.
In order to overcome this problem, an SRAM, instead of the RAM, is used in which, even when the power supply is stopped, power is constantly supplied to the RAM. That is, even when the power supply is stopped during learning, the value written in the SRAM is retained. Thus, when the power supply restarts, learning control can be continued on the basis of the retained value, making it possible to prevent the learned value from being not written in the EEPROM.
For example, Patent Document 1 describes a technique which performs learning control using an SRAM.
The learning control may be performed when the electronic control device voluntarily controls the control target, or may be performed manually when an instruction is received from an external device in accordance with a user's operation. When the electronic control device which receives an instruction from the external device performs learning control, information regarding whether the learning control has been successful or has failed can be displayed on a display section of the external device. Thus, the user can recognize the result of the operation on the display section.    Patent Document 1: JP-A-10-252547
However, if learning control is continued when the power supply restarts without distinguishing between learning control when the electronic control device controls the control target and learning control when an instruction is received from the external device, the user may misunderstand the control result due to the display content of the external device.
That is, since the power supply to the external device, which carries out predetermined initial display on the display section at the time of power-on, and the power supply to the electronic control device are made from the same power source, when the power supply restarts, information regarding whether learning control has been successful or has failed is not displayed on the display section of the external device, and predetermined initial display is carried out. Usually, while such display causes the user to recognize that learning control has failed, learning control is continued at that time, and learning control is actually successful. As a result, an error may occur between the user's recognition and the control result.